<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

header('Access-Control-Allow-Origin:*');

Route::get('/',"Index\\IndexController@index");
//后台首页
Route::get('/admin/index',"Admin\\AdminController@index");
//加载登录页面
Route::get('/admin/login',"Admin\\AdminController@login");
//验证登录信息
Route::post('/admin/loginCheck',"Admin\\AdminController@loginCheck");
//加载修改密码页面
Route::get('/admin/changPassword',"Admin\\AdminController@changPassword");
//验证修改密码
Route::post('/admin/changePasswordCheck',"Admin\\AdminController@changePasswordCheck");
//退出登录
Route::get('/admin/loginOut',"Admin\\AdminController@loginOut");




//展示文章列表页面路由
Route::get("/article/index","Article\\ArticleController@index");
//展示添加文章页面路由
Route::get("/article/create","Article\\ArticleController@create");
//展示编辑文章页面路由
Route::get("/article/{ide}/edit","Article\\ArticleController@edit");
//添加文章路由
Route::post("/article/create","Article\\ArticleController@store");
//更新文章路由
Route::post("/article/update/{id}","Article\\ArticleController@update");
//删除文章路由
Route::any("/article/destroy/{id}","Article\\ArticleController@destroy");

//获取文章数据
Route::get("/index/getArticles/{id}","Index\\IndexController@getArticles");

//上传文件路由
Route::any('/api/upload','Api\\UploadController@upload');
//获取文件路由
Route::any('/api/getPics','Api\\UploadController@getPics');

//文字转换成图片
Route::get("/article/createImage/{articles]","Article\\ArticleController@createImage");





